package com.hst.capacity.infra.convertor;


import com.hst.capacity.domain.model.entity.order.express.ExpressOrderEntity;
import com.hst.capacity.domain.model.entity.order.intercity.IntercityOrderEntity;
import com.hst.capacity.domain.model.entity.order.pool.OrderPoolEntity;
import com.hst.capacity.domain.model.response.order.OrderVO;
import com.hst.capacity.infra.external.dingtalk.model.request.order.CancelOrderRemindParam;
import com.hst.capacity.infra.external.dingtalk.model.request.order.NewOrderRemindParam;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DingTalkConvertor {

    DingTalkConvertor INSTANCE = Mappers.getMapper(DingTalkConvertor.class);

    @Mapping(target="vehicleType", source = "idVehicleType")
    @Mapping(target="passengerMobile", source = "passengerMobile")
    @Mapping(target="passengerNum", source = "passengerNumber")
    @Mapping(target="appointmentTime", source = "appointmentTime")
    @Mapping(target="orderMoney", source = "estimatedMoney")
    NewOrderRemindParam convert(OrderPoolEntity order);

    @Mapping(target="vehicleType", source = "idVehicleType")
    @Mapping(target="passengerMobile", source = "passengerMobile")
    @Mapping(target="passengerNum", source = "passengerNumber")
    @Mapping(target="appointmentTime", source = "appointmentTime")
    @Mapping(target="orderMoney", source = "estimatedMoney")
    NewOrderRemindParam convert(OrderVO order);

    @Mapping(target="vehicleType", source = "idVehicleType")
    @Mapping(target="passengerMobile", source = "passengerMobile")
    @Mapping(target="passengerNum", source = "passengerNumber")
    @Mapping(target="appointmentTime", source = "appointmentTime")
    @Mapping(target="orderMoney", source = "estimatedMoney")
    CancelOrderRemindParam convert2Cancel(OrderPoolEntity order);

    @Mapping(target="vehicleType", source = "idVehicleType")
    @Mapping(target="passengerMobile", source = "passengerMobile")
    @Mapping(target="passengerNum", source = "passengerNumber")
    @Mapping(target="appointmentTime", source = "appointmentTime")
    @Mapping(target="orderMoney", source = "estimatedMoney")
    CancelOrderRemindParam convert2Cancel(ExpressOrderEntity order);

    @Mapping(target="vehicleType", source = "idVehicleType")
    @Mapping(target="passengerMobile", source = "passengerMobile")
    @Mapping(target="passengerNum", source = "passengerNumber")
    @Mapping(target="appointmentTime", source = "appointmentTime")
    @Mapping(target="orderMoney", source = "estimatedMoney")
    CancelOrderRemindParam convert2Cancel(IntercityOrderEntity order);

}
